package learnFactoryPattern;


import pizzaTypes.NYStyleGreekPizza;
import pizzaTypes.NYStyleCheesePizza;
import pizzaTypes.NYStylePepperoniPizza;
import pizzaTypes.Pizza;
import pizzaTypes.NYStyleVeggiePizza;

public class NYPizzaStore extends PizzaStore {

	@Override
	Pizza createPizza(String type) {
		Pizza pizza = null;
		if(type.equals("cheese")) {
			pizza = new NYStyleCheesePizza();//纽约风：薄面饼，少乳酪
		}else if(type.equals("greek")) {
			pizza = new NYStyleGreekPizza();
		}else if(type.equals("pepperoni")) {
			pizza = new NYStylePepperoniPizza();
		}else if(type.equals("veggie")) {
			pizza = new NYStyleVeggiePizza();
		}else {pizza = null;}
		return pizza;
		
	}

}
